﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace LiteratureManage.Web.Validators
{
    using FluentValidation;
    using LiteratureManage.Domain.Models;

    public class LiteratureValidator : AbstractValidator<Literature>
    {
        public LiteratureValidator()
        {
            RuleFor(model => model.ArticleName)
                .NotEmpty().WithMessage("文章名称不能为空");

            RuleFor(model => model.SubjectCatalog)
                .NotEmpty().WithMessage("学科分类不能为空");

            RuleFor(model => model.ArticleSource)
                .NotEmpty().WithMessage("文章来源不能为空");

            RuleFor(model => model.ArticlePublishDate)
                .NotEmpty().WithMessage("文章表表日期不能为空");
        }
    }
}
